package com.sihan.framework.etm.mapper;


import com.framework.mybatis.mapper.BaseMapper;
import com.sihan.framework.etm.dto.WorkListDTO;
import com.sihan.framework.etm.dto.WorkTicketDTO;
import com.sihan.framework.etm.entity.WorkTicket;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface WorkTicketMapper extends BaseMapper<WorkTicket,String> {


    List<WorkTicket> listWorkTicket(@Param("dto") WorkListDTO dto);


    WorkTicketDTO findByTicketCode(@Param("ticketCode")String ticketCode);

    WorkTicketDTO findByDevId(@Param("devId")String devId);

    int alterTheState(@Param("ticketCode")String ticketCode,@Param("state") Integer state);

    /**
     * 根据工作票以及设备id判断未归还工器具数量
     * @param deviceId
     * @param ticketCode
     * @return
     */
    Integer giveBackCount(@Param("ticketCode") String ticketCode);

    Boolean insertBatchBoolean(@Param("list")List<String> ids,@Param("ticketCode")String ticketCode);

    WorkTicket selectByTowerCode(@Param("towerCode")String towerCode);

    int whetherBinding(@Param("devId")String devId);

    //int whetherBinding(@Param("devId")String devId);

}
